package com.cookor.poi.modules.phy.service;

import com.cookor.poi.common.persistence.DataEntity;
import com.cookor.poi.common.persistence.Page;
import com.cookor.poi.common.service.CrudService;
import com.cookor.poi.modules.phy.dao.TStockDao;
import com.cookor.poi.modules.phy.entity.TOrder;
import com.cookor.poi.modules.phy.entity.TStock;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(readOnly = true)
public class TStockService extends CrudService<TStockDao, TStock> {
  public TStock get(String id) {
    return (TStock)super.get(id);
  }
  
  public List<TStock> findList(TStock tStock) {
    return super.findList( tStock);
  }
  
  public Page<TStock> findPage(Page<TStock> page, TStock tStock) {
    return super.findPage(page,  tStock);
  }
  
  @Transactional(readOnly = false)
  public void save(TStock tStock) {
    super.save( tStock);
  }
  
  @Transactional(readOnly = false)
  public void delete(TStock tStock) {
    super.delete( tStock);
  }
  
  public TStock getByParam(Integer tenantId, Integer actionId, Integer doctorId, Integer year, Integer month, Integer day, Integer type) {
    return ((TStockDao)this.dao).getByParam(tenantId, actionId, doctorId, year, month, day, type);
  }
  
  public List<TStock> getListByParam(Integer tenantId, Integer doctorId, Integer year, Integer month) {
    return ((TStockDao)this.dao).getListByParam(tenantId, doctorId, year, month);
  }
  
  @Transactional(readOnly = false)
  public void addStockByOrderList(List<TOrder> orderList, int num) {
    ((TStockDao)this.dao).addStockByOrderList(orderList, num);
  }
}
